/*

GGG
*/

APPEND:
	PUSH(FP);
	MOV(FP,SP);
	PUSH(R1);
	PUSH(R2);
	PUSH(R3);
	PUSH(R4);
	PUSH(2);
	PUSH(2);
	CALL(MAKE_SOB_PAIR);
	DROP(2);
	PUSH(R0);
	MOV(R1,0);
	MOV(R3,R0);
APPEND_PARAM_LOOP:
	CMP(R1,FPARG(1));
	JUMP_EQ(APPEND_PARAM_LOOP_END);
	MOV(R2,FPARG(R1+2));
	
	
APPEND_LIST_LOOP:
	PUSH(2);
	PUSH(INDD(R2,1));
	CALL(MAKE_SOB_PAIR);
	DROP(2);
	MOV(INDD(R3,2),R0);
	MOV(R3,R0);
	MOV(R4,R2);
	MOV(R2,INDD(R2,2));
	CMP(R2,2);
	JUMP_NE(APPEND_LIST_LOOP);
	INCR(R1);
	MOV(INDD(R4,2),R0);
	MOV(R3,R0);
	JUMP(APPEND_PARAM_LOOP);
APPEND_PARAM_LOOP_END:
	

	
	POP(R0);
	MOV(R0,INDD(R0,2));
	POP(R4);
	POP(R3);
	POP(R2);
	POP(R1);
	POP(FP);
	RETURN;


